# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=akonadi-calendar-tools
pkgver=22.04.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by akonadi-calendar -> kmailtransport -> libkgapi -> qt5-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kontact.kde.org/"
pkgdesc="CLI tools to manage akonadi calendars"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	akonadi-calendar-dev
	akonadi-dev>=$pkgver
	calendarsupport-dev
	extra-cmake-modules
	kcalendarcore-dev
	kcalutils-dev
	kdoctools-dev
	libkdepim-dev
	qt5-qtbase-dev
	samurai
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-calendar-tools-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No tests available

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
781c94f2a4cdd4caec650d74efc0b8c0b2b54fbb5eca7ff6fc22190d7fca600832ac8aa6eb6b62ac3d367916d94a3512cade35b521cb5da19cda69216f06abd0  akonadi-calendar-tools-22.04.3.tar.xz
"
